<template>
  <div class="pj-box">
    <div class="title">{{ data.title }}</div>
    <div class="box" v-if="data.type == 'choice'">
      <div class="box_item" v-for="(item, i) in data.list" :key="i">
        <img src="@img/xs.png" alt="" />
        <span>{{ item.title }}</span>
      </div>
    </div>
    <div class="box" v-if="data.type == 'rate'">
      <div class="box_item1" v-for="(item, i) in data.list" :key="i">
        <span>{{ item.title }}</span>
        <van-rate v-model="item.rate" color="#FFA940" size="20px" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: Object,
  },
};
</script>

<style lang="scss" scoped>
.pj-box {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px 19px;
  margin-bottom: 12px;
  .title {
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    font-size: 16px;
    color: #272b2d;
    line-height: 22px;
    margin-bottom: 20px;
  }
  .box {
    .box_item {
      width: 33%;
      display: inline-block;
      text-align: center;
      img {
        width: 36px;
        height: 36px;
        display: block;
        margin: 0 auto 13px;
      }
      span {
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        font-size: 14px;
        color: #272b2d;
        line-height: 20px;
      }
    }
    .box_item1 {
        line-height: 24px;
      span {
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        font-size: 14px;
        color: #272b2d;
        margin-right: 19px;
      }
    }
  }
}
</style>
